Spread Windows Forms 11.0 Product Documentation
Evaluate(Object[]) Method
Example 


FarPoint.CalcEngine Assembly > FarPoint.CalcEngine Namespace > FunctionInfo Class > Evaluate Method : Evaluate(Object[]) Method
Arguments for the function evaluation
Returns the result of the function applied to the arguments.
Syntax
'Declaration
 
Public Overloads MustOverride Function Evaluate( _
   ByVal args() As Object _
) As Object
'Usage
 
Dim instance As FunctionInfo
Dim args() As Object
Dim value As Object
 
value = instance.Evaluate(args)
public abstract object Evaluate( 
   object[] args
)

Parameters

args
Arguments for the function evaluation

Return Value

Object containing the result of the function applied to the arguments
Example
This example calculates a formula without adding the formula to the control.
fpSpread1.ActiveSheet.Cells[0, 0].Value = 5;
fpSpread1.ActiveSheet.Cells[0, 1].Value = 10;
fpSpread1.ActiveSheet.Cells[0, 2].Value = 7;

object a1 = fpSpread1.ActiveSheet.GetValue(0, 0);
object a2 = fpSpread1.ActiveSheet.GetValue(0, 1);
object a3 = fpSpread1.ActiveSheet.GetValue(0, 2);

object[] args = new object[] { a1, a2, a3 };
object result = FarPoint.CalcEngine.FunctionInfo.SumFunction.Evaluate(args);
MessageBox.Show(result.ToString());
FpSpread1.ActiveSheet.Cells(0, 0).Value = 5
FpSpread1.ActiveSheet.Cells(0, 1).Value = 10
FpSpread1.ActiveSheet.Cells(0, 2).Value = 7

Dim a1 As Object = FpSpread1.ActiveSheet.GetValue(0, 0)
Dim a2 As Object = FpSpread1.ActiveSheet.GetValue(0, 1)
Dim a3 As Object = FpSpread1.ActiveSheet.GetValue(0, 2)

Dim args As Object() = New Object() {a1, a2, a3}
Dim result As Object = FarPoint.CalcEngine.FunctionInfo.SumFunction.Evaluate(args)
MessageBox.Show(result.ToString())
See Also

Reference

FunctionInfo Class
FunctionInfo Members
Overload List